<?php
require_once('header.php');
require_once('connection.php');
connect();

session_start();

if(!isset($_SESSION['user']))
{
	$_SESSION['user'] = 'Gość';
	$_SESSION['priv'] = 0;
}

if(isset($_POST['user']))
{
	$_SESSION['user'] = $_POST['user'];
	$result = mysql_query("select id, privileges from users where username='".$_SESSION['user']."';");
	$row = mysql_fetch_row($result);
	$_SESSION['id'] = (int)$row[0];
	$_SESSION['priv'] = (int)$row[1];
}

?>
	<div style="padding-left: 10px; padding-right: 10px;" class="clearfix">
<?php
require_once('menu.php');
?>
   <div style="margin-left: 210px;">
   	<h1 style="margin-top: 0">Witaj w DownloadManagerze!</h1>
      <p>
      Paweł Staś i Marcin Szymainda prezentują projekt menedżera pobierania plików.
      </p>
   </div>
	</div>
<?php
require_once('footer.php');
?>
</div>
</body>
</html>